<route lang="json5">
{
  needLogin: true,
  style: {
    navigationStyle: 'default',
    navigationBarTitleText: '学校公告',
  },
}
</route>
<script lang="ts" setup>
import { noticeDetailsApi } from '@/service/my/index'

const noticeData: any = ref()

onLoad(async () => {})

onMounted(() => {
  getNoticeDetails()
})

const getNoticeDetails = async () => {
  try {
    const pages = getCurrentPages()
    const currentPage = pages[pages.length - 1]
    const id = currentPage.$page?.options?.id
    const res: any = await noticeDetailsApi(id)
    if (res?.code === 200) {
      noticeData.value = res.data
    } else {
      console.error('')
    }
  } catch (error) {
    uni.showToast({
      title: '获取课程详情失败',
      icon: 'none',
    })
  }
}
</script>

<template>
  <view class="main_container">
    <view class="content_container">
      <view class="item_container">
        <text class="title-font">什么是超级文档</text>
      </view>

      <view>
        <wd-text
          size="24rpx"
          line-height="30rpx"
          color="#3D3D3D"
          :text="noticeData.content"
        ></wd-text>
      </view>
    </view>
  </view>
</template>

<style scoped>
.main_container {
  display: flex;
  flex-direction: column;
}

.content_container {
  min-height: 1000rpx;
  padding-right: 20rpx;
  padding-bottom: 20rpx;
  padding-left: 20rpx;
  margin-top: 20rpx;
  background-color: white;
}

.item_container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 70rpx;
}

.item_divider {
  height: 1rpx;
  background-color: rgb(243, 238, 238);
}

.title-font {
  font-size: 28rpx;
  font-weight: bold;
}

.value-font {
  font-size: 24rpx;
  color: #999999;
}
</style>
